package com.young.manager.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.young.manager.mapper.CNAreaMapper;
import com.young.manager.model.CNArea;
import com.young.manager.service.DictService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@RequiredArgsConstructor
@Service
public class DictServiceImpl implements DictService {

  private final CNAreaMapper cnAreaMapper;

  @Override
  public List<CNArea> queryChinaAreaList(Long parentId) {
    QueryWrapper<CNArea> queryWrapper = new QueryWrapper<>();
    if (null != parentId) queryWrapper.eq("pid", parentId);
    return cnAreaMapper.selectList(queryWrapper);
  }
}
